package com.java.basis.testthis;

/**
 * @author wangning
 * @create 2021-05-13 11:17
 */
class Demo1 {
	String string = "这是成员变量";
	public void print(String string) {
		System.out.println("string = " + string);
		System.out.println("this.string = " + this.string);
		//把局部变量赋值给成员变量
		this.string = string;
		System.out.println("this.string = " + this.string);

	}
}
public class This01 {
	public static void main(String[] args) {
		Demo1 demo1 = new Demo1();
		demo1.print("这是局部变量");

	}
}
